home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / amigaoscd / amigapluscd / AP-Website / forum / wbboard / reply.php < prev    next >
PHP Script  |  2002-03-15  |  6KB  |  125 lines

  1. <?
  2. require("_functions.php");
  3. require("_header.php");
  4.  
  5. $thread_info = $db_zugriff->query_first("SELECT * FROM bb".$n."_threads WHERE threadid = '$threadid'");
  6. if($boardid != $thread_info[boardparentid]) { 
  7.     eval("dooutput(\"".gettemplate("hack_error")."\");");
  8.     exit;
  9. }
  10.  
  11. if((($thread_info[authorid] && $thread_info[authorid] != $user_id && $userdata[canreplytopic]) || ($thread_info[authorid] && $thread_info[authorid] == $user_id && $userdata[canreplyowntopic]) || (!$thread_info[authorid] && $userdata[canreplytopic])) && check_boardobject($boardid,$user_group,"replypermission")) {
  12.  
  13.     if($action == "send" && !$preview) {
  14.         if($message && !check_posts($message)) {
  15.             if($user_id && !$userdata[avoidfc] && floodcontrol($user_id)) {
  16.                 require("_board_jump.php");
  17.                 eval("dooutput(\"".gettemplate("floodcontrol")."\");");
  18.                 exit;
  19.             }    
  20.             $result = newPost($boardid,$threadid,$user_id,$subject,$message,$posticon,$parseurl,$email,$disablesmilies,$signature,$close);
  21.                         if($result==2) {
  22.                                 eval ("\$output = \"".gettemplate("note4")."\";");
  23.                                 $ride = "thread.php?threadid=$threadid&boardid=$boardid&styleid=$styleid";
  24.                         }
  25.                         if($result==4) {
  26.                                 $ride = getLastPost($user_id,4);
  27.                                 header("Location: $ride");
  28.                 exit;
  29.                         }
  30.                         eval ("\$headinclude = \"".gettemplate("headinclude")."\";");
  31.             eval("dooutput(\"".gettemplate("action_ride")."\");");
  32.             exit;
  33.         }
  34.         else eval ("\$error = \"".gettemplate("newthread_error")."\";");
  35.     }
  36.     
  37.     if($ch_parseurl) $checked[0] = "CHECKED";
  38.     if($ch_email) $checked[1] = "CHECKED";
  39.     if($ch_disablesmilies) $checked[2] = "CHECKED";
  40.     if($ch_signature) $checked[3] = "CHECKED";
  41.     
  42.     if($action == "send") {
  43.      $subject=stripslashes($subject);    
  44.      $message=stripslashes($message);    
  45.     }
  46.                 
  47.     if($preview) {
  48.         $subject = prepare_topic($subject);
  49.                 $user_info = $db_zugriff->query_first("SELECT signatur FROM bb".$n."_user_table WHERE username='$user_name'");
  50.                 if($user_info[signatur] && $signature && !$hide_signature) {
  51.                            $signatur = editSignatur($user_info[signatur],$disablesmilies);
  52.             eval ("\$pre_signature = \"".gettemplate("thread_signature")."\";");
  53.         }
  54.                 if($posticon) $pre_posticon = "<img src=\"".$posticon."\">";
  55.                 else $pre_posticon = " ";
  56.                 $post = editPost($message,$disablesmilies);
  57.                 $message = stripslashes($message);             
  58.                 eval ("\$preview = \"".gettemplate("preview")."\";");
  59.                         
  60.                 if($parseurl) $checked[0] = "CHECKED";
  61.         else $checked[0] = "";
  62.         if($email) $checked[1] = "CHECKED";
  63.         else $checked[1] = "";
  64.         if($disablesmilies) $checked[2] = "CHECKED";
  65.         else $checked[2] = "";
  66.         if($signature) $checked[3] = "CHECKED";
  67.         else $checked[3] = "";
  68.         if($close) $checked[4] = "CHECKED";
  69.         else $checked[4] = "";
  70.         }
  71.         else $subject=htmlspecialchars($subject);
  72.     
  73.     if($bbcode && $u_bbcode) $bbcode_buttons = getcodebuttons();
  74.     if($smilies && $u_bbcode) $bbcode_smilies = getclickysmilies(3,$anzahl_smilies);
  75.     if($html) eval ("\$note .= \"".gettemplate("newthread_html_enable")."\";");
  76.     else eval ("\$note .= \"".gettemplate("newthread_html_disable")."\";");
  77.     if(!$smilies) eval ("\$note .= \"".gettemplate("newthread_smilies_disable")."\";");
  78.     if(!$bbcode) eval ("\$note .= \"".gettemplate("newthread_bbcode_disable")."\";");
  79.  
  80.     include("templates/posticons.php");
  81.     for($i = 0; $i < count($posticons); $i++) {
  82.         if(is_int($i/6) && $i) $choice_posticons .= "<br>";
  83.         elseif($i) $choice_posticons .= "    ";
  84.         $choice_posticons .= "<INPUT type=\"radio\" name=\"posticon\" value=\"$posticons[$i]\"";
  85.         if($posticon == $posticons[$i]) $choice_posticons .= " CHECKED";
  86.         $choice_posticons .= ">  <img src=\"$posticons[$i]\">";
  87.     }
  88.     if(!$posticon) $noicon[0] = "CHECKED"; 
  89.         
  90.     $navi_chain = makenavichain("reply",$boardid,$threadid);
  91.     if($mode=="quote" && !$preview) {
  92.         $message = $db_zugriff->query_first("SELECT threadparentid, userid, message FROM bb".$n."_posts WHERE postid='$postid'");
  93.         if($message[threadparentid]==$threadid) {
  94.             if($message[userid]) $username = getUsername($message[userid]);
  95.             else eval ("\$username = \"".gettemplate("lg_anonymous")."\";");
  96.             $quote = prepare_quote($message[message]);
  97.             eval ("\$message = \"".gettemplate("reply_quote")."\";");
  98.         }
  99.     }
  100.  
  101.     if($thread_info[replies]+1 <= $eproseite) {
  102.             $post_result = $db_zugriff->query("SELECT bb".$n."_posts.*, bb".$n."_user_table.username FROM bb".$n."_posts LEFT JOIN bb".$n."_user_table USING (userid) WHERE threadparentid='$threadid' ORDER by posttime DESC LIMIT 0,".($eproseite));
  103.             while($posts = $db_zugriff->fetch_array($post_result)) {
  104.                        unset($posttopic);
  105.                     if($posts[userid]) $authorname = $posts[username];
  106.                     else eval ("\$authorname = \"".gettemplate("lg_anonymous")."\";");
  107.                     if($posts[posticon]) $posticon = "<img src=\"".$posts[posticon]."\">";
  108.                     else $posticon = " ";
  109.                     $posttopic = prepare_topic($posts[posttopic]);
  110.                     $post = editPost($posts[message],$posts[disable_smilies]);
  111.                        $backcolor = rowcolor($j);
  112.                     eval ("\$reply_threadview .= \"".gettemplate("reply_threadview")."\";");
  113.                     $j++;
  114.             }
  115.     } 
  116.     else eval ("\$reply_threadview = \"".gettemplate("reply_to_many_posts")."\";");
  117.     
  118.     if(($thread_info[authorid] && $thread_info[authorid] == $user_id && $userdata[cancloseowntopic]) || ($userdata[ismod] && check_boardobject($boardid,$user_id,"mod"))|| $userdata[issupermod]) eval ("\$quick_close = \"".gettemplate("reply_quick_close")."\";");
  119.  
  120.     if($userid) eval ("\$quick_logout .= \"".gettemplate("newthread_logout")."\";");
  121.     $message=htmlspecialchars($message);
  122.     eval("dooutput(\"".gettemplate("reply")."\");");
  123. }
  124. else header("LOCATION: misc.php?action=access_error&boardid=$boardid&styleid=$styleid$session");
  125. ?>